<template>
  <div class="rsAddress">
    <div class="mian">
      <div class="content">
        <div class="title">
          <i class="iconfont icon-guanbi" @click="isShowAddress"></i>
          确认获取
        </div>
        <p>
          <label for="userName">收件人</label>
          <input type="text" id="userName" placeholder="请输入收件人" v-model="MC">
        </p>
        <p>
          <label for="userName">手机号</label>
          <input type="text" id="userName" placeholder="请输入手机号" v-model="YJEYhOld">
        </p>
        <p>
          <label for="userName">地址详情</label>
          <input type="text" id="userName" placeholder="请输入地址" v-model="MS">
        </p>
        <!-- <div class="txt">挖取人工费.包装费.邮费（500元）</div> -->
        <div class="btn" @click="confirmAccess">提 交</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapActions } from "vuex";
import { addJYEBagAddress } from "../../../api";
import { getGuid } from "@/utils/index";
import { Toast } from "mint-ui";

export default {
  props: ["id"],
  data() {
    return {
      MS: "",
      MC: "",
      YJEYhOld: "",
      userid: localStorage.zyUserId
    };
  },
  mounted() {},
  methods: {
    ...mapActions(["isShowAddress"]),
    confirmAccess() {
      if (!this.MS || !this.MC || !this.YJEYhOld) {
        Toast({
          message: "请确认填写正确信息！",
          duration: 2000
        });
        return;
      }
      addJYEBagAddress({
        MS: this.MS,
        MC: this.MC,
        YJEYhOld: this.YJEYhOld,
        ID: this.userid,
        YJELQss: this.id,
        LoginMachine: getGuid()
      }).then(res => {
        if (res.data.Success) {
          Toast({
            message: res.data.Content,
            duration: 2000
          });
          this.$parent.getBagList();
        }
      });
      this.isShowAddress();
    }
  }
};
</script>
<style lang="stylus" scoped>
.rsAddress {
  width: 100%;
  height: 100%;
  background: rgba(0, 1, 3, 0.9);
  position: fixed;
  left: 0;
  top: 0;

  .mian {
    width: 7.04rem;
    // height: 10.88rem;
    background: #FFF;
    border-radius: 0.2rem;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    .content {
      width: 6.63rem;
      margin: 0 auto;

      .title {
        margin: 0.15rem auto 1rem auto;
        line-height: 1rem;
        text-align: center;
        border-bottom: 1px solid rgba(137, 137, 137, 1);
        position: relative;

        i {
          position: absolute;
          left: 0;
          top: 2px;
        }
      }

      p {
        line-height: 0.6rem;
        display: flex;
        margin: 30px 0;

        label {
          color: rgba(40, 44, 52, 1);
          font-size: 15px;
          width: 1.6rem;
          flex: 0 1 1.6rem;
          margin-left: 10px;
        }

        input {
          height: 0.6rem;
          background: #768397;
          border-radius: 0.14rem;
          padding-left: 5px;
          flex: 1;
          font-size: 15px;
          color: #FFF;
        }

        input::placeholder {
          color: #FFF;
        }
      }

      .txt {
        text-align: center;
        margin: 1.5rem 0 0.5rem 0;
      }

      .btn {
        width: 6.18rem;
        line-height: 1rem;
        text-align: center;
        margin: 1.5rem auto;
        font-size: 20px;
        color: #FFF;
        background: linear-gradient(-42deg, rgba(249, 71, 1, 1), rgba(250, 81, 5, 1), rgba(253, 110, 17, 1));
        box-shadow: 0px 3px 9px 0px rgba(91, 24, 0, 0.47);
        opacity: 0.97;
        border-radius: 0.1rem;
      }
    }
  }
}
</style>

